#pragma once
#include <iostream>

class Task
{
public:
    Task(int num1=1, int num2=2)
    :_num1(num1)
    ,_num2(num2)
    {}
    int operator()() //所有需要执行的任务成员函数名写成operator()，线程池执行时通过task()同一调用
    {
        int result = _num1+_num2;
        std::cout << _num1 << " + " << _num2 << " = " << result << std::endl;
        return result;
    }
private:
    int _num1;
    int _num2;
};